import request from '@/utils/request'

export default {
  knowledgeList(params) {
    return request({
      url: '/v1/knowledgeList',
      method: 'get',
      params
    })
  },
  getOne(id) {
    return request({
      url: `/v1/knowledge/${id}`,
      method: 'get'
    })
  },
  create(data) {
    return request({
      url: '/v1/knowledgeAdd',
      method: 'post',
      data
    })
  },
  update(data) {
    return request({
      url: '/v1/knowledgeUpdate',
      method: 'post',
      data
    })
  },
  delete(id) {
    return request({
      url: `/v1/knowledgeDel/${id}`,
      method: 'get'
    })
  },
  categoryTree() {
    return request({
      url: '/v1/knowledgeTree',
      method: 'get'
    })
  },
  excel(data) {
    return request({
      url: '/v1/knowledgeExcel',
      method: 'post',
      data
    })
  },
  excelUpdate(data) {
    return request({
      url: '/v1/knowledgeExcelUpdate',
      method: 'post',
      data
    })
  },
  appendAdmin(data) {
    return request({
      url: '/v1/knowledgeAdminAppend',
      method: 'post',
      data
    })
  },
  removeAdmin(data) {
    return request({
      url: '/v1/knowledgeAdminRemove',
      method: 'post',
      data
    })
  }
}
